<?php
  class index{  
    private $template;
    private $util;
    private $db;
    
    public function __construct(){
        require_once 'code/template.class.php';  
        require_once 'code/util.class.php';  
        require_once 'code/db.class.php';  
        $this->template = new template();
        $this->util = new util();
        $this->db = new db();
    }
    
    public function autorun(){
         //load module
        $mid = isset($_GET['module'])?$_GET['module']:'gallery';
        $lang = isset($_GET['l'])?$_GET['l']:'en'; 
        $act = isset($_GET['act'])?$_GET['act']:'';
        switch($mid){
           case 'index': 
           case 'gallery':
           case 'music':                      
           case 'cafe':
                break;
           default:
                $mid = 'gallery';
                break;
           }     
    
  
        require_once("module\\{$lang}\\{$mid}.php"); 
        $module = 'front_'.$mid;
        $module_obj = new $module;
      
        $module_obj->autorun();
      
    }
}
?>
